package org.edu.modules.oa.controller;

import groovy.util.logging.Slf4j;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.edu.common.api.vo.Result;
import org.edu.common.aspect.annotation.AutoLog;
import org.edu.modules.oa.service.XoaCommonUserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author: 陈炜凡
 * @Description: TODO
 * @DateTime: 2021/7/31 8:54
 */

@Api(tags = "工作管理")
@RestController
@RequestMapping("oa/user")
@Slf4j
public class XoaCommonUserController {
    @Resource
    private XoaCommonUserService xoaCommonUserService;

    @AutoLog(value = "同步用户数据")
    @ApiOperation(value="同步用户数据", notes="同步用户数据")
    @PostMapping(value = "/synchronizeUser")
    public Result<?> synchronizeUser(String userId){
        xoaCommonUserService.synchronizeUserInfoById(userId);
        return Result.OK();
    }

    @AutoLog(value = "根据用户id修改")
    @ApiOperation(value="根据用户id修改", notes="根据用户id修改")
    @PostMapping(value = "/synchronizeUserById")
    public Result<?> synchronizeUserById(String userId){
        xoaCommonUserService.synchronizeUserById(userId);
        return Result.OK();
    }
}
